package com.snapp.web.actions.statics;

import javax.servlet.http.HttpServletRequest;

import com.snapp.util.Bean;
import com.snapp.util.Statics;
import com.snapp.web.SNAppAction;

public class Load extends SNAppAction {

	public String execute(HttpServletRequest req) {
		
		try {
			String mnemonic = req.getParameter("mnemonic");
				
			Bean tp = Statics.get(mnemonic).getBean();
			setBodyElement(tp.toXML());
			
			setResultCode(1);
			setResultMessage("FactoryLocal type loaded successfully");
			
		}catch(Exception e) {
			log("Error loading object from catalog", e);
			setResultCode(-1);
			setResultMessage("Error loading object from catalog");
		}
		
		return super.execute(req);
	}
}
